package com.happy.controller;

import com.happy.entity.RecordEntity;
import com.happy.entity.UserEntity;
import com.happy.service.IRecordService;
import com.happy.util.ResultBody;
import com.happy.util.StateEnum;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping ("/record")
@CrossOrigin (value = "*", maxAge = 3600)
public class RecordController {


    @Resource
    private IRecordService iRecordService;

    /**
     * 获取测试记录
     * @param recordEntity
     * @return
     */
    @RequestMapping ("/queryList")
    @ResponseBody
    public ResultBody<RecordEntity> queryList ( RecordEntity recordEntity ) {
        List<RecordEntity> recordEntities = iRecordService.queryList ( recordEntity );
        return ResultBody.success ( recordEntities, recordEntities.size () );
    }

}
